/**
 * @param {number[]} nums
 * @return {number}
 */
var findMaxConsecutiveOnes = function(nums) {
  let num_str = nums.join("").split("0")
  console.log(num_str)
  let max_length = 0

  num_str.forEach(item => {
    if (item.length > max_length) max_length = item.length
  })

  return max_length
}

console.log(findMaxConsecutiveOnes([0, 1, 0, 1, 1, 1]))
